{layout name="layout/header" /}
<link href="root/css/plugins/footable/footable.core.css" rel="stylesheet">
<link href="root/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="root/css/plugins/switchery/switchery.css" rel="stylesheet">
<script src="root/js/plugins/switchery/switchery.js"></script>
<link href="root/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
<link href="root/css/plugins/datapicker/datepicker3.css" rel="stylesheet">

<link href="root/css/plugins/summernote/summernote.css" rel="stylesheet">
<link href="root/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
<div class="wrapper wrapper-content animated fadeInRight" id="app">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>用户详情</h5>

                </div>
                <div class="ibox-title">
                    <p>
                        <button type="button" class="btn btn-primary btn-outline refresh">刷新</button>
                        <a type="button" class="btn btn-primary btn-outline " href="{:url('index')}">返回列表页</a>
                    </p>
                </div>
                <div class="ibox-content">
                    <div class="tabs-container">
                        <ul class="nav nav-tabs">
                            <!--参展-->
                            {if condition="$user.role==1"}
                            <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">参展机构信息</a>
                            </li>
                            <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">参展机构联系人信息</a>
                            </li>
                            <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">机构类型及业务范围</a>
                            </li>
                            <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">展位类型</a>
                            </li>
                            <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">参会人员信息</a>
                            </li>
                            <li class=""><a data-toggle="tab" href="#tab-6" aria-expanded="false">凭证</a>
                            </li>
                            {elseif condition="$user.role==2"/}
                            <!--参观-->
                            <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">参观机构信息</a>
                            </li>
                            <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">参观机构联系人信息</a>
                            </li>
                            <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">机构类型及业务范围</a>
                            </li>
                            <li class=""><a data-toggle="tab" href="#tab-7" aria-expanded="false">参会人员信息</a>
                            </li>
                            <li class=""><a data-toggle="tab" href="#tab-6" aria-expanded="false">凭证</a>
                            </li>
                            {else/}
                            <!--媒体-->
                            <li class="active"><a data-toggle="tab" href="#tab-8" aria-expanded="true">媒体信息</a>
                            </li>
                            {/if}
                        </ul>
                        <div class="tab-content">
                            {if condition="$user.role<3"}
                            <div id="tab-1" class="tab-pane active">
                                <div class="panel-body">
                                    <form method="post" class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">机构名称（中文）</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.orgname}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">机构名称（英文）</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.orgname_en}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">详细地址</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.address}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">邮编</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.postcode}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">国家（地区）</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.region}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">电话</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.zone}  {$data.phone}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">传真</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.fax}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">电子邮箱</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.email}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">网址</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.website}</p>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <div id="tab-2" class="tab-pane">
                                <div class="panel-body">
                                    <form method="post" class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">联系人</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.contactor}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">部门</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.contactor_department}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">职务</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.contactor_position}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">电子邮箱</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.contactor_email}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">手机号码</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.contactor_cellphone}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">电话</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.contactor_zone}  {$data.contactor_phone}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">传真</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.contactor_fax}</p>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>

                            <!--机构类型及业务范围-->
                            <div id="tab-3" class="tab-pane">
                                <div class="panel-body">
                                    <form method="post" class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">制作机构</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.producer_type}  {$data.custom_producer_type}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">发行机构</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.publisher_type}  {$data.custom_publisher_type}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">购买机构类型</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.purchaser_type}  {$data.custom_purchaser_type}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">购买节目范围</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.purchase_range}  {$data.custom_purchase_range}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">其他机构和个人</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.other_type}  {$data.custom_other_type}</p>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <!--展位类型-->
                            <div id="tab-4" class="tab-pane">
                                <div class="panel-body">
                                    <form method="post" class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">展位名称</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$data.booth.booth_name}</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">是否包含套餐</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">
                                                    {if condition="$data.booth.with_package"}
                                                    是
                                                    {else/}
                                                    否
                                                    {/if}
                                                </p>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <!--参会人员信息-->
                            <div id="tab-5" class="tab-pane">
                                <div class="panel-body">
                                    <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th>姓名</th>
                                            <th>职务</th>
                                            <th>机构或部门名称</th>
                                            <th>电话</th>
                                            <th>照片</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {volist name="data.stuff" id="vo"}
                                        <tr pid="{$vo.id}" >
                                            <td>{$vo.name}</td>
                                            <td>{$vo.position}</td>
                                            <td>{$vo.department}</td>
                                            <td>{$vo.phone}</td>
                                            <td>
                                                <a class="fancybox" href="{$vo.avatar_url}">
                                                    <img style="width: 80px" src="{$vo.avatar_url}"/>
                                                </a>

                                            </td>

                                        </tr>
                                        {/volist}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div id="tab-7" class="tab-pane">
                                <div class="panel-body">
                                    <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th>姓名</th>
                                            <th>性别</th>
                                            <th>职务</th>
                                            <th>电话</th>
                                            <th>照片</th>
                                            <th>参会身份</th>
                                            <th>推优作品名称</th>
                                            <th>是否购买套餐</th>
                                            <th>选择标准</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {volist name="data.stuff" id="vo"}
                                        <tr pid="{$vo.id}" >
                                            <td>{$vo.name}</td>
                                            <td>{$vo.gender}</td>
                                            <td>{$vo.position}</td>
                                            <td>{$vo.phone}</td>
                                            <td>
                                                <a class="fancybox" href="{$vo.avatar_url}" >
                                                    <img style="width: 80px" src="{$vo.avatar_url}"/>
                                                </a>
                                            </td>
                                            <td>{switch name="$vo.conference_ident"}
                                                {case value="0"}买家{/case}
                                                {case value="1"}参会来宾{/case}
                                                {case value="2"}优推代表{/case}
                                                {/switch}
                                            </td>
                                            <td>{$vo.work_name}</td>
                                            <td>{if condition="$vo.buy_package==1"}
                                                是
                                                {else/}
                                                否
                                                {/if}
                                            </td>
                                            <td>
                                                {if condition="$vo.buy_package==1"}
                                                    {if condition="$vo.live_alone==1"}
                                                        独住
                                                    {else/}
                                                        拼住
                                                    {/if}
                                                {else/}
                                                    {if condition="$vo.pay_onsite==1"}
                                                        提前汇款
                                                    {else/}
                                                        现场支付
                                                    {/if}
                                                {/if}
                                            </td>

                                        </tr>
                                        {/volist}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div id="tab-6" class="tab-pane">
                                <div class="panel-body">
                                    <form method="post" class="form-horizontal">
                                        {notempty name="$user.verification_detail"}
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">上次审核失败原因</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$user.verification_detail}</p>
                                            </div>
                                        </div>
                                        {/notempty}
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">总金额</label>
                                            <div class="col-sm-11">
                                                <p class="form-control-static">{$user.total_fee} 元</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-1 control-label">凭证</label>
                                            <div class="col-sm-11">
                                                <div class="row" id="img">
                                                    <div class="img_box col-xs-12 col-md-3" >
                                                        <a class="fancybox" href="{$user.credential_url}">
                                                            <img alt="image" src="{$user.credential_url}"/>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            {else/}
                            <div id="tab-8" class="tab-pane active">
                                <div class="panel-body">
                                    <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th>所属机构名称</th>
                                            <th>姓名</th>
                                            <th>部门</th>
                                            <th>职位</th>
                                            <th>联系电话</th>
                                            <th>身份证照片</th>
                                            <th>记者站/公司介绍信凭证</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {volist name="data" id="vo"}
                                        <tr pid="{$vo.id}" >
                                            <td>{$vo.orgname}</td>
                                            <td>{$vo.contactor}</td>
                                            <td>{$vo.contactor_department}</td>
                                            <td>{$vo.contactor_position}</td>
                                            <td>{$vo.contactor_phone}</td>
                                            <td>
                                                <a class="fancybox" href="{$vo.idcard_url}" >
                                                    <img style="width: 80px" src="{$vo.idcard_url}"/>
                                                </a>
                                            </td>
                                            <td>
                                                <a class="fancybox" href="{$vo.paperwork_url}" >
                                                    <img style="width: 80px" src="{$vo.paperwork_url}"/>
                                                </a>
                                            </td>


                                        </tr>
                                        {/volist}
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            {/if}
                        </div>
                    </div>


                </div>
            </div>
        </div>
    </div>
</div>

<!-- iCheck -->
<script src="root/js/plugins/iCheck/icheck.min.js"></script>
<!--layer-->
<script src="root/js/plugins/layer/layer.min.js"></script>
<script src="root/js/plugins/summernote/summernote.min.js"></script>
<script src="root/js/plugins/summernote/summernote-zh-CN.js"></script>
<script src="root/js/plugins/fancybox/jquery.fancybox.js"></script>
<script src="root/js/plugins/datapicker/bootstrap-datepicker.js"></script>

<script src="root/js/plugins/validate/jquery.validate.min.js"></script>
<script src="root/js/plugins/validate/messages_zh.min.js"></script>
<script>
    $(function () {
        checks();

        $('.fancybox').fancybox({
            openEffect: 'none',
            closeEffect: 'none'
        });
    })
    //审核通过
    function pass(id) {

        var msg = '确定审核通过吗?'
        layer.open({
            content: msg
            ,btn: ['确定', '取消']
            ,yes: function(index){
                $.post("{:url('pass')}",{id:id},function (res) {
                    layer.msg(res.msg);
                    if(res.code){
                        setTimeout(function () {
                            $('#table').bootstrapTable('refresh');
                        },2000)
                    }
                },'json')
                layer.close(index);
            }
        });
    }
    //审核不通过
    function unpass(id) {
        var msg = '确定审核不通过吗?'
        layer.open({
            content: msg
            ,btn: ['确定', '取消']
            ,yes: function(index){
                layer.close(index);
                layer.open({
                    type: 1,
                    title:"请输入审核不通过原因",
                    skin: 'layui-layer-rim', //加上边框
                    area: ['420px', '180px'], //宽高
                    content: '<input type="text" id="invalid_reason" class="form-control">',
                    btn: ['提交', '取消'],
                    yes: function(index, layero){
                        reason = $('#invalid_reason').val().trim();
                        if(reason ==''){
                            layer.msg('审核不通过的原因不能为空');
                            return;
                        }
                        $.post("{:url('unpass')}",{id:id,reason:reason},function (res) {
                            layer.close(index);
                            layer.msg(res.msg);
                            if(res.code){
                                setTimeout(function () {
                                   window.location.href="{:url('index')}";
                                },2000)
                            }
                        },'json')
                    }
                })

            }
        });
    }

</script>

